
import instance from "../utils/request";
export function sendCode(phone:string) {
    return instance({
        url: '/user/sendCode',
        method: 'post',
        data : phone

    })
}
export async function login(loginFrom:Object) {
    return instance({
        url: `/user/login`,
        method: 'post',
        data:loginFrom
    })
}

export async function getMyReports(id:String,time:String) {
    return instance({
        url: `/report/getMyReports/${id}/${time}`,
        method: 'get',
   
    })
}

export async function getImageByReportNo(id:string) {
    return instance({
        url: `/report/getImageByReportNo/${id}`,
        method: 'get',
   
    })

}

export async function saveUser(user:object) {
    return instance({
        url: `/user/saveUser`,
        method: 'post',
        data: JSON.stringify(user)

    })
}

    export async function sendOpinion(opinion: object) {
        return instance({
            url: `/opinion/sendOpinion`,
            method: 'post',
            data: JSON.stringify(opinion)

        })

    }


export async function getArticles() {
    return instance({
        url: `/admin/article/getAllArticles`,
        method: 'get',


    })

}
